<?
//<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
require 'inc.php';
if($_GET['id'])
{
	$db_goods = new db($scfg['db']['goods']);	
	//var_dump($db_goods);
	//var_dump($db_member);
	$arr	  = pct::de($_GET['id']);
    //$arr["urs"] = urs;
	$table    = "goods_info";
	$table_desc ="goods_info_desc";
	$where    = array(
		"where"=>" where gYmd =:gYmd and gid =:gid ",
		"bind"=>$arr
	);
	$rs 	  	= $db_goods->row("select * from {$table} {$where['where']} ",$where['bind']);
	
	//echo $db_goods->getsql();
	//var_dump($rs);
	//print_r($rs);
	if($rs)
	{
		$rs_desc 	= $db_goods->row("select * from {$table_desc} {$where['where']} ",$where['bind']); 
		$rs["sDesc"]= $rs_desc["sDesc"];
		$catIdArr	= array(
								"c1id" =>$rs["c1id"],
								"c2id" =>$rs["c2id"],
								"c3id" =>$rs["c3id"],
								"c4id" =>$rs["c4id"],
							);
		$catNameArr = cat::id2name($db_goods,$catIdArr);
		$img        = pct::img($arr["gYmd"],$arr["gid"]);
		
		$db_member 	= new db($scfg['db']['member']);	
		$area 		= pct::area($db_member,$rs);
		//print_r($catNameArr);
		//print_r($catIdArr);		
		tpl::assign('id',$_GET['id']);
		tpl::assign('area',$area);
		tpl::assign('img',$img);
		tpl::assign('rs',$rs);
		tpl::assign('catIdArr',$catIdArr);
		tpl::assign('catNameArr',$catNameArr);
		tpl::display("pct.tpl.php");
		exit();
	}
}
echo "参数错误!";
//tpl::display("pct.tpl.php");
?>